<?php 

require('conf/top.php');

$qcm_view = new QcmView();
$rubrique_view = new RubriqueView();

include("templates/header.tpl.php");

 $links_level1 = array('rubriques' 
                        => array('template'=>'rubriques.tpl.php',
                                 'view'=>$rubrique_view),	
                       'qcm' 
                        => array('template'=>'qcm.tpl.php',
                                 'view'=>$qcm_view),
                       'utilisateur' 
                        => array('template'=>'utilisateur.tpl.php',
                                 'view'=>$qcm_view),
                       'qcm-add' 
                        => array('template'=>'qcm-add.tpl.php',
                                 'view'=>$qcm_view),
                );
    
    if(isset($_GET['rub'])  && array_key_exists($_GET['rub'],$links_level1)){
            $tpl=$links_level1[$_GET['rub']]['template'];     
            $view = $links_level1[$_GET['rub']]['view'];
            $view->display($tpl);          
    }else{
          include("templates/accueil.tpl.php");	
    }    
   
include("templates/footer.tpl.php");
?>